﻿@{
    Layout = null;
}
<div class="panel-body" style="padding:0">
    <div class="panel panel-default">
        <div class="panel-heading"></div>
        <div class="panel-body">
            <form id="formSearch" class="form-horizontal">
                  <div class="form-group">
                    @if (string.IsNullOrEmpty(ViewBag.MerchantId))
                    {
                        <p style="color:red;font-size:20px;margin-left:30px;">该商户还未配置店铺信息，没有资金收入，不允许申请体现</p>
                    }
                </div>
                <div class="form-group">
                    <label class="control-label" for="number_search">结算号:</label>
                    <div class="col-sm-2">
                        <input type="text" class="form-control" id="number_search" placeholder="请输入商户结算号">
                    </div>
                    <label class="control-label" for="settlementstatus_search">结算状态:</label>
                    <div class="col-sm-2">
                        <select class="form-control" id="settlementstatus_search">
                            <option value="-1">全部</option>
                            <option value="1">已提交</option>
                            <option value="2">已完成</option>
                            <option value="3">失败</option>
                            <option value="4">取消</option>
                        </select>
                    </div>
                    <div class="col-sm-3">
                        <button type="button" id="btnQueryList" class="btn btn-primary"><i class="fa fa-search"></i>查询</button>
                        <button type="button" id="btnReset" class="btn btn-primary"><i class="fa fa-remove"></i>清空</button>
                    </div>
                </div>
            </form>
            <hr />
            <div>
                <table id="settlementinfo"></table>
            </div>
        </div>
    </div>
</div>

<div id="toolbar" class="btn-group">
    <button id="btnApplyWithdrawDialog" type="button" class="btn btn-primary"><span><i class="fa fa-plug"></i>&nbsp;申请体现</span></button>
    <button id="btnFailureDialog" type="button" class="btn btn-primary"><span><i class="fa fa-plug"></i>&nbsp;失败原因</span></button>  
</div>

@*商户申请体现信息*@
<div class="modal fade" id="ApplyWithdrawModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title" id="HeadTitle">商户申请体现信息</h4>
            </div>
            <div class="modal-body">
                <form id="ApplyWithdrawOperation" method="post" class="form-horizontal">
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">商户信息:</span>
                            <input type="text" id="MerchantName" name="MerchantName" value="@ViewBag.MerchantName" class="form-control" readonly="readonly" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">总金额:</span>
                            <input type="text" id="OrderAmount" name="OrderAmount" value="@ViewBag.Balance" class="form-control" readonly="readonly"  />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">待提现金额:</span>
                            <input type="text" id="CanSettlementAmount" name="CanSettlementAmount" value="@ViewBag.ResidueMoney" class="form-control" readonly="readonly" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">收款方式:</span>
                            <select id="ReceivablesId" name="ReceivablesId" class="selectpicker show-tick form-control"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">申请提现金额:</span>
                            <input type="text" id="ActSettlementAmount" name="ActSettlementAmount" class="form-control"  />
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnApplyWithdrawOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="FailureModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title" id="HeadTitle">结算失败原因</h4>
            </div>
            <div class="modal-body">
                <form id="FailureOperation" method="post" class="form-horizontal">
                    <div class="form-group">
                        <div class="input-group">
                            失败原因是：<span id="Remark"></span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
            </div>
        </div>
    </div>
</div>

<script src="~/Scripts/project/min/merchantsettlment.min.js"></script>
<script type="text/javascript">
    $(function () {
        ml.admin.merchantsettlment.init({
            MerchantId: "@ViewBag.MerchantId"
        });
    })
</script>